package com.notary.data.service;

import com.alibaba.fastjson.JSONObject;
import com.notary.data.request.SyncDataRequest;
import com.notary.entity.vo.JsonResult;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.util.List;

/**
 * @author Administrator
 */
public interface OfficeRequestService {


    /**
     * 校验服务器
     */

    public JSONObject checkToken(JSONObject data);

    /**
     * 根据传送编号查询公证信息
     *
     * @param data
     * @return
     */
    public JSONObject queryNotaryByTransNo(JSONObject data) throws Exception;

    /**
     * 传送数据
     *
     * @param data
     * @return
     */
    public JSONObject getOrderInfo(JSONObject data) throws Exception;


    /**
     * 获取公证信息
     *
     * @param data
     * @return
     */
    public JSONObject getNotaryInfo(JSONObject data) throws Exception;

    /**
     * 回调通知公证信息
     *
     * @param notaryNo
     * @return
     */
    public JSONObject callback(String notaryNo) throws Exception;

    /**
     * 获取公证员信息
     *
     * @param data
     * @return
     */
    public JSONObject getNotaryIdAndName(JSONObject data) throws Exception;

    /**
     * 查询公证事项
     *
     * @param data
     * @return
     */
    public JSONObject queryPurpose(JSONObject data) throws Exception;

    /**
     * 获取公证事项
     *
     * @param data
     * @return
     */
    public JSONObject queryNotaryItemInfo(JSONObject data) throws Exception;


    /**
     * 下载公证书
     *
     * @param data
     * @return
     */
    public byte[] querySealNotaryPdf(JSONObject data) throws Exception;

    /**
     * 申请出具执行证书
     *
     * @param data
     * @return
     * @throws Exception
     */
    public JSONObject applyExecCert(JSONObject data) throws Exception;


    /**
     * 下载执行证书
     *
     * @param contractNo
     * @return
     */
    public byte[] downloadExecCert(@RequestParam("contractNo") String contractNo, HttpServletResponse response) throws Exception;

    /**
     * 获取案件状态
     *
     * @param data
     * @return
     */
    public JSONObject getNotaryStatus(JSONObject data) throws Exception;

    /**
     * 同步公证处数据
     *
     * @param data
     * @return
     */
    JSONObject syncData(JSONObject data) throws Exception;

    /**
     * 定时任务批量同步公证处数据
     *
     * @param syncDataList
     * @return
     */
    void dealSyncData(List<SyncDataRequest> syncDataList) throws Exception;

    /**
     * 获取公证书存证哈希和执行证书存证哈希
     *
     * @param data
     * @return
     */
    JsonResult getNotaryOrExecuteHashCode(JSONObject data);
}
